package com.mooc.lib_video.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.mooc.lib_video.R
import com.mooc.lib_video.im.model.TextEntity
import com.tb.emoji.EmojiUtil
import java.io.IOException

class LiveCommentAdapter : BaseQuickAdapter<TextEntity,BaseViewHolder>(R.layout.item_comment) {

    override fun convert(holder: BaseViewHolder, item: TextEntity) {
        val live_comment_tv : TextView = holder.getView(R.id.live_comment_tv)
        holder.setText(R.id.live_comment_tv,item.content)
        try {
            EmojiUtil.handlerEmojiText(live_comment_tv, item.content, context)
        } catch (e: IOException) {
            e.printStackTrace()
        }
    }
}